<template>
    <div class="dialogBox">
        <el-dialog :title="dialogTitle" :visible.sync="appendDialog" :before-close="cencelSend" width="50%" center>
            <el-table :data="tableData" height="250" border style="width: 100%;color:#EDEDED; border-color: #1560AC;"
                :cell-style="{ background: '#123150', borderColor: '#1560AC', color: '#EDEDED' }"
                :row-style="{ background: '#123150', borderColor: '#1560AC', color: '#EDEDED' }"
                :header-cell-style="{ background: '#123150', borderColor: '#1560AC', color: '#EDEDED', fontSize: '14px', }">
                <el-table-column prop="taskName" label="任务名称" align="center">
                </el-table-column>
                <el-table-column prop="poolType" label="工艺属性" align="center">
                </el-table-column>
                <el-table-column prop="poolNo" label="池体编号" align="center">
                </el-table-column>
                <el-table-column prop="adValue" label="氨氮" align="center">
                </el-table-column>
                <el-table-column prop="xdValue" label="硝氮" align="center">
                </el-table-column>
                <el-table-column prop="lsyValue" label="磷酸盐" align="center">
                </el-table-column>
                <el-table-column prop="execution_time" label="执行时间" align="center">
                </el-table-column>
            </el-table>
            <!-- <span slot="footer" class="dialog-footer">
                <el-button class="btn1" @click="cencelSend('ruleForm')">取 消</el-button>
                <el-button class="btn2" @click="addRobot('AddRobotData')">确 定</el-button>
            </span> -->
        </el-dialog>
    </div>
</template>

<script>
import {getReportCenter} from  '@/api/cyRobot/report'
export default {
    props: ['dialogTitle', 'appendDialogVisible', 'detailsId'],
    name: 'AddAndEdit',
    data() {
        return {
            tableData:[],
            //新增or修改按钮
            appendDialog: false,
            //选中的任务
            choiceId: this.detailsId
        };
    },

    mounted() {

    },
    methods: {
        //获取检测报告详情
        getreportTable(){
            getReportCenter(this.choiceId).then(response => {
                this.tableData = response.data
            })
        },
        // 取消
        cencelSend(ruleForm) {
            this.$emit('cencelSend',)//触发父组件的子组件上绑定的cencelSend方法
        },
        //确定
        addRobot(ruleForm) {
            this.$emit('cencelSend',)//触发父组件的子组件上绑定的cencelSend方法
        },
    },
    watch: {
        detailsId(newValue,oldValue){
            this.choiceId = newValue
            this.getreportTable()
        },
        //监听父组件传过来表单打开状态
        appendDialogVisible(newValue, oldValue) {
            this.appendDialog = newValue
        }
    }
}
</script>

<style lang="scss" scoped>
::v-deep .el-dialog:not(.is-fullscreen) {
    margin-top: 15vh !important;
}

.dialogBox {
    ::v-deep .el-table{
        background-color: #123150;
    }
    ::v-deep .el-dialog__header {
        background-color: #123150;
        color: #ffff;
    }

    ::v-deep .el-dialog__title {
        color: #ffff;
    }

    ::v-deep .el-dialog__body {
        background-color: #123150;
    }

    ::v-deep .el-dialog__footer {
        background-color: #123150;
    }

    ::v-deep .el-input__inner {
        background-color: #123150;
        color: #EDEDED;
    }

    ::v-deep .el-form-item__label {
        color: #EDEDED;
    }

    ::v-deep .el-form-item__label {
        width: 105px !important;
    }

    ::v-deep .el-input__inner {
        margin-bottom: 18px;
    }

    ::v-deep .el-input__inner {
        border-color: #1560AC;
    }


    ::v-deep .gutter {
        background-color: #123150;
    }

    //最底下的线条
    ::v-deep .el-table::before,
    .el-table--group::after,
    .el-table--border::after {
        background-color: #1560AC;
    }

    .el-table__fit {
        background-color: #123150;
    }

    ::v-deep .el-table__body-wrapper {
        background-color: #123150;
    }

    ::v-deep .el-dialog__header {
        background-color: #123150;
        color: #ffff;
    }

    ::v-deep .el-dialog__title {
        color: #ffff;
    }

    ::v-deep .el-dialog__body {
        background-color: #123150;
    }

    ::v-deep .el-dialog__footer {
        background-color: #123150;
    }

    ::v-deep .el-input__inner {
        background-color: #123150;
        color: #EDEDED;
    }

    ::v-deep .el-form-item__label {
        color: #EDEDED;
    }

    ::v-deep .el-form-item__label {
        width: 102px !important;
    }

    ::v-deep .el-input__inner {
        margin-bottom: 18px;
    }

    ::v-deep .el-input__inner {
        border-color: #1560AC;
    }

    .dialog-footer {
        display: flex;
        justify-content: center;

        .btn1 {
            width: 80px;
            height: 30px;
            display: flex;
            justify-content: center;
            align-items: center;
            border: 1px solid #F0F0F0;
            border-radius: 5px;
            margin-right: 10%;
        }

        .btn2 {
            width: 80px;
            height: 30px;
            display: flex;
            justify-content: center;
            align-items: center;
            border: 1px solid #F0F0F0;
            border-radius: 5px;
        }

        ::v-deep .el-button--default {
            background-color: #123150;
        }

        ::v-deep .el-button--default:hover {
            background-color: #F0F0F0;
        }

        ::v-deep .el-button--default {
            color: #E1E2E5;
        }

        ::v-deep .el-button--default:hover {
            color: #142150;
        }
    }
}
</style>
